package com.example.dw.util;

public class BusinessFormulaMethods {

    // 计算折扣价格
    public static Double calculateDiscount(Double originalPrice, Double discountRate) {
        return originalPrice * (1 - discountRate / 100);
    }

    // 计算税费
    public static Double calculateTax(Double amount, Double taxRate) {
        return amount * taxRate / 100;
    }

    // 格式化金额
    public static String formatCurrency(Double amount) {
        return String.format("¥%.2f", amount);
    }

    // 根据分数评级
    public static String getGrade(Integer score) {
        if (score >= 90) return "优秀";
        if (score >= 80) return "良好";
        if (score >= 70) return "中等";
        if (score >= 60) return "及格";
        return "不及格";
    }
}
